package com.ltsh.fim.common.model;

import com.alibaba.fastjson.JSONObject;

import java.util.Map;

public class FimResponse {
    private long id;
    private byte[] data;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }
    public Map<String, Object> getMap() {
        byte[] data = this.getData();
        if(data != null) {
            return JSONObject.parseObject(data, Map.class);
        }
        return null;
    }
    public <T> T toBean(Class<T> tClass) {
        byte[] data = this.getData();
        if(data != null) {
            return JSONObject.parseObject(data, tClass);
        }
        return null;
    }
}
